//
//  SearchDayRangeV.swift
//  ANOA
//
//  Created by 邱仙凯 on 2023/2/11.
//  Copyright © 2023 zwb. All rights reserved.
//   左边搜索框 右边日期的固定搜索

import UIKit
class SearchMonthRangeV:RangeBaseV {
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        
        startD = Date.preMonths(6)
        endD = Date.currentMonth
       
        
        let topViewController = RouterUtils.currentTopViewController()!
   
        startBtn.addTouchUpInSideAction { _ in
            let view = KSSelectMonthView()
            view.fetchData = { month in
                self.startD = month
                 if let clo = self.startSearchClo {
                    clo(self.searchStr,self.startD,self.endD)
                }
            }
            view.show()
            
           
        }
        endBtn.addTouchUpInSideAction { _ in
            let view = KSSelectMonthView()
            view.fetchData = { month in
                self.endD = month
                 if let clo = self.startSearchClo {
                    clo(self.searchStr,self.startD,self.endD)
                }
            }
            view.show()
        }
    }
    
    @MainActor required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
